package com.github.hiling.gateway;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

@RefreshScope
@RestController
public class TestController {

    @Value("${test:aaa}")
    private String configValue;

    @GetMapping("/test")
    public ResponseEntity<String> test() {
        return ResponseEntity.ok("current Time:" + LocalDateTime.now() + " -- " + configValue);
    }
}